|
|
scott wrote:
> I really don't understand why you find it so hard to learn C.
(I really don't understand why everybody else finds it so hard to learn
Haskell, but there we are.)
> There are only a tiny number of core statements (like if, while, return
> etc) and the syntax of them all is very similar. How to write functions
> you just have to learn, but that's the same for any language. Writing
> mathematical formulae is also very easy and similar to almost every
> other language (using + - / * etc).
>
> If you want to get more advanced, then learn to handle arrays and what &
> and * do (quite easy things to remember, not complex at all), and you're
> pretty much set to understand 99.999% of C code out there - including
> things like while(*v++ = *s++);
>
> What's the problem?
printf() - obviously.
Any operation involving strings seems to require you to use functions
with names like "strnmsx" or something. (What, you couldn't afford a few
more octets for some extra letters?)
Manual memory management is tricky in any language, but at least in
(say) Pascal, strings are managed for you. And let's face it, strings
are *the* most common reason for using variable-sized arrays.
I spent about 3 days trying to figure out the syntax for making function
pointers work. After endless segfaults, I just gave up. It was too hard.
Which one is FALSE? Is that 0 or 1? I know it's one or the other, but I
can never ever remember which - and it's kind of important!
What insane nutcase thought that making assignment an expression as a
good idea? Seriously, WTF? That's excellent. So if I say "if (x = 5)..."
then my program will silently fail to work correctly, and I'll probably
spend hours if not days trying to figure out why.
Boolean operators and bitwise operators. Which is which? Which ones are
the short-circuit ones, and which aren't? I can never remember.
Pointers in general usually result in disaster. I constantly get the
syntax wrong for pointer types, pointer dereferencing, and pointer creation.
Apparently you're not supposed to mutate strings encoded in the program
source code. It seems to make Strange Things happen.
What's the difference between #include "" and include <>?
Preprocessor macros. (Need I say more?)
Header files, make files, include files, "extern", the whole shooting
match. Wuh?
At least some of these things appear to be fixed in C++.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|